<linker>
  <assembly fullname="System.Private.CoreLib">
    <!-- Workaround for https://github.com/mono/linker/issues/378 -->
    <type fullname="System.Runtime.InteropServices.IDispatch" />
    <type fullname="System.Runtime.InteropServices.IMarshal" />
    <type fullname="Internal.Runtime.InteropServices.IClassFactory2" />
    <!-- ComActivator is needed for native host operations -->
    <type fullname="Internal.Runtime.InteropServices.ComActivator" >
      <method name="GetClassFactoryForTypeInternal" />
      <method name="RegisterClassForTypeInternal" />
      <method name="UnregisterClassForTypeInternal" />
    </type>

    <!-- Enables the .NET IJW host (before .NET 7.0) to load an in-memory module as a .NET assembly.
        These are always rooted to ensure native calls get trimmer related errors
        but their bodies will be mostly trimmed away by the related feature switch -->
    <type fullname="Internal.Runtime.InteropServices.InMemoryAssemblyLoader">
      <method name="LoadInMemoryAssembly" />
    </type>
  </assembly>

  <assembly fullname="System.Private.CoreLib" feature="System.Runtime.InteropServices.BuiltInComInterop.IsSupported" featurevalue="true">
    <!-- Enables the .NET COM host (.NET 8.0+) to load a COM component. -->
    <type fullname="Internal.Runtime.InteropServices.ComActivator" >
      <method name="GetClassFactoryForTypeInContext" />
      <method name="RegisterClassForTypeInContext" />
      <method name="UnregisterClassForTypeInContext" />
    </type>
  </assembly>

  <assembly fullname="System.Private.CoreLib" feature="System.Runtime.InteropServices.EnableCppCLIHostActivation" featurevalue="true">
    <!-- Enables the .NET IJW host (.NET 7.0+) to load an in-memory module as a .NET assembly. -->
    <type fullname="Internal.Runtime.InteropServices.InMemoryAssemblyLoader">
      <method name="LoadInMemoryAssemblyInContext" />
    </type>
  </assembly>
</linker>
